<!doctype html>
<style>
body, #tbody2 {
  contain: size layout;
}
</style>
<script src="../../resources/check-layout.js"></script>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script type="text/javascript">
    function reparentRow() {
        document.getElementById("tbody2").appendChild(document.getElementById("row"));
    }
    runAfterLayoutAndPaint(reparentRow, true);
</script>
<p>This shouldn't crash.</p>
<table>
  <tr id="row"><td style="height:50px;width:50px;background:green"></td></tr>
</table>
<table style="height:20px;width:20px">
  <tbody id="tbody2">
  </tbody>
</table>
